mudbox::Node Class Reference

#include <node.h>

Inheritance diagram for mudbox::Node:

Inheritance graph
[legend]
List of all members.

Detailed Description

This is the base class for most classes in the Mudbox SDK.

Node enumeration and retrieval function

The following functions are used for enumerating over nodes.

Node Next (void) const
  Returns the next node in the chain. Used to enumerate the current nodes. See also First().
int  ID (void) const
  Returns an ID for the node. The ID is unique in the whole application life.
Node First (void)
  This function will return the first node in the memory. Used to enumerate all the current nodes. See also Next().
Node ByID (int iID)
  Returns the node with the specified ID, or zero if such a node does not exists.
Node ByName (const QString &sClass, const QString &sName)
  Search for a node with the name sName. Will return 0 if the node was not found.

Public Member Functions

  Node (const QString &sName="")
  Standard constructor. You can specify the name of the node which will be used in the user interface. See Name().
virtual  ~Node (void)
virtual void  Initialize (void)
void  LoadTemplate (const QString &sFileName="", bool bStartEvent=false)
  Use an external XML file to initialize the attributes.
void  SaveTemplate (const QString &sFileName="", bool bSaveOnlyVisible=false)
  Save current attributes as an XML template.
unsigned int  Version (void) const
  Returns the current version of the node. This number increases when the content of the node changed (when ContentChanged() called).
void  SetVersion (unsigned int iVersion)
  Sets the current version number for the node.
virtual QString  Name (const ClassDesc *pClass=0) const
  Returns the name of the node. Can be overwritten in derived classes.
void  SetName (const QString &sName)
  Sets the name of the node. Has no effect if Name() is overwritten in a derived class.
void  Annex (Node *pSource, const QString &sCategory="")
  Relink all the attributes of the source node to this one.
virtual void  Serialize (Stream &s)
  Serializes the node.
bool  IsKindOf (const ClassDesc *pClass) const
  Returns true if this node is derived from the pClass class.
void  ContentChanged (void) const
  This function must be called if the content of the node is changed.
virtual const mudbox::ClassDesc RuntimeClass (void) const
Event functions
These functions are used for working with node events, such as notifications to changes to an attribute.

virtual void  OnNodeEvent (const Attribute &cAttribute, NodeEventType cType)
  This function is called if an event occurs with any of the attributes of the node.
virtual void  OnEvent (const EventGate &cEvent)
  This function is called when a generic event occurs. See EventGate class.
void  RequestDeferredEvent (Attribute &cAttribute)
  Request for a deferred event, which will occur only in the main loop.
Attribute methods
These functions are for working with attributes.

unsigned int  AttributeCount (void) const
  Returns the number of attributes owned by the node.
Attribute AttributeByIndex (int iIndex) const
  Returns a specified attribute (or 0 if iIndex is greater than the number of attributes).
Attribute AttributeByName (const QString &sName) const
  Returns a specified attribute by its name. Returns 0 if the attribute not found.
Attribute AttributeByID (const QString &sID) const
  Returns a specified attribute by its ID. Returns 0 if the attribute not found.
void  LogAttributes (void) const
  Write all attributes into the log file.
virtual QWidget *  CreatePropertiesWindow (QWidget *pParent)
  Create a window which displays the attributes of the node. Can be overriden to provide a custom interface.

Static Public Member Functions

const mudbox::ClassDesc StaticClass (void)
mudbox::Node CreateInstances (unsigned int iCount=1)

Public Attributes

AttributeThisPointer  m_pThis

Friends

struct  Attribute
class  Stream
class  EventGate

Constructor & Destructor Documentation

mudbox::Node::Node const QString &  sName = ""  ) 
 

Standard constructor. You can specify the name of the node which will be used in the user interface. See Name().

virtual mudbox::Node::~Node void   )  [virtual]
 

Member Function Documentation

virtual void mudbox::Node::Initialize void   )  [virtual]
 

Reimplemented in mudbox::MeshRenderer, and mudbox::ViewPortFilter.

virtual void mudbox::Node::OnNodeEvent const Attribute cAttribute,
NodeEventType  cType
[virtual]
 

This function is called if an event occurs with any of the attributes of the node.

All derived classes should override this function to be able to handle attribute events.

Parameters:
cAttribute  The attribute which caused the event. The attribute has a special == operator to make it easier to implement this function. You can write the following:
        void MyClass::OnNodeEvent( const Attribute &cAttribute, NodeEventType cType )
        {
            if ( cAttribute == myAttribute0 )
            {
                ...
            }
            else if ( cAttribute == myAttribute1 )
            {
                ...
            }
        }
This comparison will check the address of the two attributes and NOT their values.
cType  Type of the event occured.

Reimplemented in mudbox::BrushOperation, mudbox::Preferences, and mudbox::AttributeWidget.

virtual void mudbox::Node::OnEvent const EventGate cEvent  )  [virtual]
 

This function is called when a generic event occurs. See EventGate class.

void mudbox::Node::RequestDeferredEvent Attribute cAttribute  ) 
 

Request for a deferred event, which will occur only in the main loop.

void mudbox::Node::LoadTemplate const QString &  sFileName = "",
bool  bStartEvent = false
 

Use an external XML file to initialize the attributes.

void mudbox::Node::SaveTemplate const QString &  sFileName = "",
bool  bSaveOnlyVisible = false
 

Save current attributes as an XML template.

unsigned int mudbox::Node::Version void   )  const
 

Returns the current version of the node. This number increases when the content of the node changed (when ContentChanged() called).

Reimplemented in mudbox::Stream.

void mudbox::Node::SetVersion unsigned int  iVersion  ) 
 

Sets the current version number for the node.

Node* mudbox::Node::First void   )  [static]
 

This function will return the first node in the memory. Used to enumerate all the current nodes. See also Next().

Node* mudbox::Node::Next void   )  const
 

Returns the next node in the chain. Used to enumerate the current nodes. See also First().

Reimplemented in mudbox::Layer, and mudbox::ViewPortFilter.

int mudbox::Node::ID void   )  const
 

Returns an ID for the node. The ID is unique in the whole application life.

Node* mudbox::Node::ByID int  iID  )  [static]
 

Returns the node with the specified ID, or zero if such a node does not exists.

Node* mudbox::Node::ByName const QString &  sClass,
const QString &  sName
[static]
 

Search for a node with the name sName. Will return 0 if the node was not found.

virtual QString mudbox::Node::Name const ClassDesc pClass = 0  )  const [virtual]
 

Returns the name of the node. Can be overwritten in derived classes.

Reimplemented in mudbox::BrushOperation.

void mudbox::Node::SetName const QString &  sName  ) 
 

Sets the name of the node. Has no effect if Name() is overwritten in a derived class.

Reimplemented in mudbox::LayerMeshData, and mudbox::TexturePool.

void mudbox::Node::Annex Node pSource,
const QString &  sCategory = ""
 

Relink all the attributes of the source node to this one.

unsigned int mudbox::Node::AttributeCount void   )  const
 

Returns the number of attributes owned by the node.

Attribute* mudbox::Node::AttributeByIndex int  iIndex  )  const
 

Returns a specified attribute (or 0 if iIndex is greater than the number of attributes).

Attribute* mudbox::Node::AttributeByName const QString &  sName  )  const
 

Returns a specified attribute by its name. Returns 0 if the attribute not found.

Attribute* mudbox::Node::AttributeByID const QString &  sID  )  const
 

Returns a specified attribute by its ID. Returns 0 if the attribute not found.

void mudbox::Node::LogAttributes void   )  const
 

Write all attributes into the log file.

virtual QWidget* mudbox::Node::CreatePropertiesWindow QWidget *  pParent  )  [virtual]
 

Create a window which displays the attributes of the node. Can be overriden to provide a custom interface.

virtual void mudbox::Node::Serialize Stream s  )  [virtual]
 

Serializes the node.

Override this function in your plug-in to save and load attributes and custom data with the Mudbox file.

Reimplemented in mudbox::BrushOperation, mudbox::LayerContainer, mudbox::NURBSCurve, mudbox::Preferences, mudbox::SelectionSet, mudbox::Topology, and mudbox::TreeNode.

bool mudbox::Node::IsKindOf const ClassDesc pClass  )  const
 

Returns true if this node is derived from the pClass class.

void mudbox::Node::ContentChanged void   )  const
 

This function must be called if the content of the node is changed.

All other nodes which has an AttributePointer pointing to this node will receive a event notficiation of type etPointerContentChanged (See NodeEventType).

virtual const mudbox::ClassDesc* mudbox::Node::RuntimeClass void   )  const [inline, virtual]
 

Reimplemented in mudbox::BrushOperation, mudbox::BrushMask, mudbox::BrushStamp, mudbox::BrushStencil, mudbox::Camera, mudbox::Geometry, mudbox::Image, mudbox::EnvironmentMap, mudbox::ImageFilter, mudbox::Importer, mudbox::Exporter, mudbox::Action, mudbox::FileEvent, mudbox::KeyboardEvent, mudbox::Kernel, mudbox::Layer, mudbox::LayerContainer, mudbox::LayerMeshData, mudbox::Light, mudbox::Material, mudbox::TextureMixer, mudbox::TexturePool, mudbox::Texture, mudbox::RenderTarget, mudbox::SubSpace, mudbox::Selector, mudbox::Mesh, mudbox::TangentGenerator, mudbox::Picker, mudbox::ScreenSpacePicker, mudbox::MeshGrid, mudbox::SurfaceSmoother, mudbox::NURBSCurve, mudbox::Operation, mudbox::Preferences, mudbox::MeshRenderer, mudbox::VertexDataProvider, mudbox::Scene, mudbox::SelectionSet, mudbox::Stream, mudbox::SubdivisionLevel, mudbox::GroupNode, mudbox::Transformation, mudbox::TransformationPalette, mudbox::TrayAccessor, mudbox::TreeNode, mudbox::ViewPortFilter, and mudbox::ViewPort.

00787 :
    QString m_sName;
const mudbox::ClassDesc* mudbox::Node::StaticClass void   )  [static]
 

Reimplemented in mudbox::BrushOperation, mudbox::BrushMask, mudbox::BrushStamp, mudbox::BrushStencil, mudbox::Camera, mudbox::Geometry, mudbox::Image, mudbox::EnvironmentMap, mudbox::ImageFilter, mudbox::Importer, mudbox::Exporter, mudbox::Action, mudbox::FileEvent, mudbox::KeyboardEvent, mudbox::Kernel, mudbox::Layer, mudbox::LayerContainer, mudbox::LayerMeshData, mudbox::Light, mudbox::Material, mudbox::TextureMixer, mudbox::TexturePool, mudbox::Texture, mudbox::RenderTarget, mudbox::SubSpace, mudbox::Selector, mudbox::Mesh, mudbox::TangentGenerator, mudbox::Picker, mudbox::ScreenSpacePicker, mudbox::MeshGrid, mudbox::SurfaceSmoother, mudbox::NURBSCurve, mudbox::Operation, mudbox::Preferences, mudbox::MeshRenderer, mudbox::VertexDataProvider, mudbox::Scene, mudbox::SelectionSet, mudbox::Stream, mudbox::SubdivisionLevel, mudbox::GroupNode, mudbox::Transformation, mudbox::TransformationPalette, mudbox::TrayAccessor, mudbox::TreeNode, mudbox::ViewPortFilter, and mudbox::ViewPort.

mudbox::Node* mudbox::Node::CreateInstances unsigned int  iCount = 1  )  [static]
 

Reimplemented in mudbox::BrushOperation, mudbox::BrushMask, mudbox::BrushStamp, mudbox::BrushStencil, mudbox::Camera, mudbox::Geometry, mudbox::Image, mudbox::EnvironmentMap, mudbox::ImageFilter, mudbox::Importer, mudbox::Exporter, mudbox::Action, mudbox::FileEvent, mudbox::KeyboardEvent, mudbox::Kernel, mudbox::Layer, mudbox::LayerContainer, mudbox::LayerMeshData, mudbox::Light, mudbox::Material, mudbox::TextureMixer, mudbox::TexturePool, mudbox::Texture, mudbox::RenderTarget, mudbox::SubSpace, mudbox::Selector, mudbox::Mesh, mudbox::TangentGenerator, mudbox::Picker, mudbox::ScreenSpacePicker, mudbox::MeshGrid, mudbox::SurfaceSmoother, mudbox::NURBSCurve, mudbox::Operation, mudbox::Preferences, mudbox::MeshRenderer, mudbox::VertexDataProvider, mudbox::Scene, mudbox::SelectionSet, mudbox::Stream, mudbox::SubdivisionLevel, mudbox::GroupNode, mudbox::Transformation, mudbox::TransformationPalette, mudbox::TrayAccessor, mudbox::TreeNode, mudbox::ViewPortFilter, and mudbox::ViewPort.


Friends And Related Function Documentation

friend struct Attribute [friend]
 
friend class Stream [friend]
 
friend class EventGate [friend]
 

Member Data Documentation

AttributeThisPointer mudbox::Node::m_pThis
 

mudbox::Node mudbox::Node mudbox::Node mudbox::Node mudbox::Node mudbox::Node mudbox::Node mudbox::Node mudbox::Node mudbox::Node
mudbox::Node mudbox::Node mudbox::Node mudbox::Node mudbox::Node mudbox::Node mudbox::Node mudbox::Node mudbox::Node mudbox::Node